#ifndef _MAIN_STATE_
#define _MAIN_STATE_

#include "FEApplication.h"
#include "KeyboardInputListener.h"
#include "MouseInputListener.h"

#include "FreeCameraHandler.h"

#include "HeightMap.h"
#include "PrimitiveCube.h"

#include "StatPanel.h"
#include "TextLabel.h"


class MainState : public FEngine::FEApplication, public FEngine::KeyboardInputListener, public FEngine::MouseInputListener
{

	public:

		MainState();
		~MainState();
		void initialize();
		
		void updateGUI(double _elapsedTime);
		void update(double _elapsedTime);
		void render(double _elapsedTime);

		void keyPressed(int _key);
		void keyReleased(int _key);
		void mouseButtonPressed(int _button, const Vector2& _position);
		void mouseButtonReleased(int _button, const Vector2& _position);
		void mouseMoved(const Vector2& _delta);
		

	private:

		FEngine::HeightMap*			mMap;
		FEngine::FreeCameraHandler* mCameraHandler;
		StatPanel*					mStatPanel;
		
		std::list<FEngine::TextLabel*> mListLabels;

		FEngine::PrimitiveCube* soleil;
		FEngine::PrimitiveCube* terre;
		FEngine::PrimitiveCube* lune;
	
		FEngine::Node*			soleilNode_base;
		FEngine::Node*			terreNode_base;
		FEngine::Node*			terreNode_center;
		FEngine::Node*			luneNode_base;
};

#endif
